package com.ch04a;

public class CounterThread implements Runnable
{	
	String threadName;
	
	public CounterThread(String name) {
		threadName = name;
		Thread t = new Thread(this);
		t.start();
	}
	public void run()
	{
		for (int i=0; i<1000000; i++)
		{
			if (i%100000 == 0)
				System.out.println(i + "," + this.threadName);
		}
	}
	
	public static void main(String args[]) {
		CounterThread t1 = new CounterThread("Thread 1");
		CounterThread t2 = new CounterThread("Thread 2");
		CounterThread t3 = new CounterThread("Thread 3");
	}
}

